import { FormConfig, type ItemConfig } from '@/components/DynamicForm/type'


export const itemConfigArray: ItemConfig[] = [{
  key: 'tellerNo',
  label: '工号',
  componentName: 'textarea',
  rows: 1,
  isKey: 1,
  change: 'testChange',
  disabled: 0
}, {
  key: 'password',
  label: '员工密码',
  componentName: 'password',
  showPassword: true
}, {
  key: 'branchNo',
  label: '员工机构号',
  componentName: 'input',
  change: 'testChange',
  groupNo: 1
}, {
  key: 'datetimeRange',
  label: '时间范围',
  componentName: 'date-range'
}, {
  key: 'datetime',
  label: '时间日期',
  componentName: 'datetime'
}
]
export const formConfig: FormConfig = {
  tightLayout: 0,
  itemsConfig: itemConfigArray,
  columns: 3,
  isUpdate: 0,
  submitButtonName: '提交',
  style: '',
  formRules: {
    /*必须输入,失去焦点时校验*/
    tellerNo: [{ required: true, message: '请输入员工工号', trigger: 'blur' }],
    /*可不输入，如果输入则必须为6位,失去焦点时校验*/
    branchNo: [{ min: 6, max: 6, message: '员工机构号为6位', trigger: 'blur' }],
    /*类型为数组，必须输入，变化时校验*/
    datetimeRange: [{ type: 'array', required: true, message: '请选择日期', trigger: 'change' }],
    /*类型为数组，必须输入，变化时校验*/
    datetime: [{ type: 'string', message: '类型不符合', trigger: 'change' }]
  },
  formRulesFun: ['branchNo']
}
